const Koa = require('koa')
const app = new Koa()
const path = require('path')


// 静态资源
app.use(require('koa-static')(path.resolve(__dirname, 'public')))
// 连接数据库
require('./utils/connect')

// 开启koa-body对文件数据的解析，默认只能普通post提交的body数据 开启图片上传 multipart:true
app.use(require("koa-body")({ multipart: true }))
app.use(require('./routes/index').routes())


app.listen(8888, () => console.log('port 8888 is running'))